Skip to contentSkip to conversation

OpenVPN 2.6.7 released

Openvpn-devel Yuriy Darnobyt 4 participants 14 messages Nov 9, 2023 – Nov 14, 2023

lore
Share & tools
lore
#0 lore raw

The OpenVPN community project team is proud to release OpenVPN 2.6.7.

This is a bugfix release containing security fixes.

Security Fixes:

* CVE-2023-46850 OpenVPN versions between 2.6.0 and 2.6.6 incorrectly use a send buffer after it has been free()d in some circumstances, causing some free()d memory to be sent to the peer. All configurations using TLS (e.g. not using --secret) are affected by this issue. (found while tracking down CVE-2023-46849 / Github #400, #417)
* CVE-2023-46849 OpenVPN versions between 2.6.0 and 2.6.6 incorrectly restore --fragment configuration in some circumstances, leading to a division by zero when --fragment is used. On platforms where division by zero is fatal, this will cause an OpenVPN crash.(Github #400, #417).

User visible changes:

* DCO: warn if DATA_V1 packets are sent by the other side - this a hard incompatibility between a 2.6.x client connecting to a 2.4.0-2.4.4 server, and the only fix is to use --disable-dco.
* Remove OpenSSL Engine method for loading a key. This had to be removed because the original author did not agree to relicensing the code with the new linking exception added. This was a somewhat obsolete feature anyway as it only worked with OpenSSL 1.x, which is end-of-support.
* add warning if p2p NCP client connects to a p2mp server - this is a combination that used to work without cipher negotiation (pre 2.6 on both ends), but would fail in non-obvious ways with 2.6 to 2.6.
* add warning to --show-groups that not all supported groups are listed (this is
due the internal enumeration in OpenSSL being a bit weird, omitting X448 and X25519 curves).
* --dns: remove support for exclude-domains argument (this was a new 2.6 option,
with no backend support implemented yet on any platform, and it turns out that
no platform supported it at all - so remove option again)
* warn user if INFO control message too long, do not forward to management client (safeguard against protocol-violating server implementations)

New features:

* DCO-WIN: get and log driver version (for easier debugging).
* print "peer temporary key details" in TLS handshake
* log OpenSSL errors on failure to set certificate, for example if the algorithms used are in acceptable to OpenSSL (misleading message would be printed in cryptoapi / pkcs11 scenarios)
* add CMake build system for MinGW and MSVC builds
* remove old MSVC build system
* improve cmocka unit test building for Windows

Windows MSI changes since 2.6.6:

* Included openvpn-gui updated to 11.45.0.0
* Add clarity for error on missing management parameter. See GH #657
* Improve "OpenVPN GUI" tooltip handling See GH #649
* MSIs now use OpenSSL 3.1.4

More details can be found in the Changes document:

<https://github.com/OpenVPN/openvpn/blob/release/2.6/Changes.rst>

(The Changes document also contains a section with work-arounds for common problems encountered when using OpenVPN with OpenSSL 3)

Source code and Windows installers can be downloaded from our download page:

<https://openvpn.net/community-downloads/>

Debian and Ubuntu packages are available in the official apt repositories:

<https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos#DebianUbuntu:UsingOpenVPNaptrepositories>

On Red Hat derivatives we recommend using the Fedora Copr repository.

<https://copr.fedorainfracloud.org/coprs/dsommers/openvpn-release-2.6/>

Kind regards,
Yuriy Darnobyt

#1 lore raw

10.11.2023 00:56, Yuriy Darnobyt пишет:

Quoted 1 line

The OpenVPN community project team is proud to release OpenVPN 2.6.7.

something is broken in 2.6.7. it stops passing traffic after several seconds after connection when acts as server,

so I reverted it back to 2.6.6.

compiled from sources on ubuntu 22.04 with --disable-dco

don't know where is problem, at least now.

#2 lore raw

10.11.2023 10:21, Dmitry Melekhov пишет:

Quoted 4 lines

10.11.2023 00:56, Yuriy Darnobyt пишет:

Quoted 1 line

The OpenVPN community project team is proud to release OpenVPN 2.6.7.

Quoted 9 lines

something is broken in 2.6.7. it stops passing traffic after several seconds after connection when acts as server,

so I reverted it back to 2.6.6.

compiled from sources on ubuntu 22.04 with --disable-dco

don't know where is problem, at least now.

OK, now I know what is broken.

I have so called multihomed server,  and multihomed udp does not work in 2.6.7.

On server with only one external interface everything works OK.

Could you, please, fix this?

#3 lore raw

Hi,

Quoted 6 lines · Dmitry Melekhov

OK, now I know what is broken.

I have so called multihomed server,  and multihomed udp does not work in 2.6.7.

On server with only one external interface everything works OK.

Are you using --multihome in your config? If not, please add this - UDP on a server with multiple IP addresses of the same family (v4 or v6) can not work reliably without --multihome.

If it does not work with --multihome, please send logs.

(There is one multihome-related code change in 2.6.6 -> 2.6.7, but that should only ever trigger if you use DCO)

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#4 lore raw

10.11.2023 11:23, Gert Doering пишет:

Quoted 5 lines

Hi,

Quoted 2 lines · Dmitry Melekhov

OK, now I know what is broken.

Quoted 7 lines
Quoted 4 lines

I have so called multihomed server,  and multihomed udp does not work in 2.6.7.

On server with only one external interface everything works OK.

Are you using --multihome in your config? If not, please add this - UDP on a server with multiple IP addresses of the same family (v4 or v6) can not work reliably without --multihome.

yes, sure.

as I said 2.6.6 works OK , and all previous versions since multihomed support for udp was introduced.

Quoted 2 lines

If it does not work with --multihome, please send logs.

I see nothing strange in logs, server just lost connection, client too, then they reconnects.

Quoted 2 lines

(There is one multihome-related code change in 2.6.6 -> 2.6.7, but that should only ever trigger if you use DCO)

I don't use dco, but multihomed udp does not work.

Quoted 4 lines

gert

#5 lore raw

btw, what I missed, openvpn dies:

openvpn[11346]: segfault at 0 ip 000055e33503f5f3 sp 00007fff33642390 error 4 in openvpn[55e334fc8000+8f000]

but only  multipoint udp .

10.11.2023 11:35, Dmitry Melekhov пишет:

Quoted 34 lines

10.11.2023 11:23, Gert Doering пишет:

Quoted 5 lines

Hi,

Quoted 2 lines · Dmitry Melekhov

OK, now I know what is broken.

Quoted 7 lines
Quoted 4 lines

I have so called multihomed server,  and multihomed udp does not work in 2.6.7.

On server with only one external interface everything works OK.

Are you using --multihome in your config? If not, please add this - UDP on a server with multiple IP addresses of the same family (v4 or v6) can not work reliably without --multihome.

yes, sure.

as I said 2.6.6 works OK , and all previous versions since multihomed support for udp was introduced.

Quoted 1 line

If it does not work with --multihome, please send logs.

I see nothing strange in logs, server just lost connection, client too, then they reconnects.

Quoted 2 lines

(There is one multihome-related code change in 2.6.6 -> 2.6.7, but that should only ever trigger if you use DCO)

I don't use dco, but multihomed udp does not work.

Quoted 3 lines

gert

#6 lore raw

Hi,

Quoted 6 lines · Dmitry Melekhov

btw, what I missed, openvpn dies:

openvpn[11346]: segfault at 0 ip 000055e33503f5f3 sp 00007fff33642390 error 4 in openvpn[55e334fc8000+8f000]

but only  multipoint udp .

This is bad (but very different from "it stops forwarding", so it should be much easier to reproduce). Can you produce a log file with "verb 4" so it shows what is happening before that?

I'll see if I can reproduce this case here and we'll fix it ASAP.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#7 lore raw

Hi,

Quoted 1 line · Gert Doering

I'll see if I can reproduce this case here and we'll fix it ASAP.

We couldn't reproduce it yet, but we have a crash dump in GH issue #449, which hints at the commit cd4d819c99266 getting this double-extra-check wrong.

So if you build from git, can you do a checkout of release/2.6, and then do "git revert cd4d819c99266", and build from that? This would give you a 2.6.7 "with both CVE fixes, but without the extra safeguard check" - which isn't *really* needed, but its intention was "should another mistake of sort addressed in the CVE fixes happen again, it would get caught" - so double belt and suspenders...

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#8 lore raw

Segfaulting STR:

Rocky9 host, used 2.6.7 from the copr repo.
================================
port 1194
proto tcp-server
dev tun1
ca /etc/openvpn/server/keys/ca.crt
cert /etc/openvpn/server/keys/server.crt
key /etc/openvpn/server/keys/server.key
dh none
tls-groups secp521r1:secp384r1
topology subnet
server 10.50.236.0 255.255.255.0
keepalive 10 120
tls-auth /etc/openvpn/server/keys/ta.key 0
data-ciphers AES-256-GCM
auth SHA512
tls-version-min 1.2
user openvpn
group openvpn
persist-key
persist-tun
log-append /var/log/openvpn/openvpn.log
verb 4
auth-gen-token 0 3600
================================

Spun this config up, then ran:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 443,80 -j REDIRECT --to-ports 1194

Within 5 minutes the random web scanners found and segfaulted me.

Hope this helps.

Quoted 32 lines · Gert Doering

Hi,

Quoted 1 line · Gert Doering

I'll see if I can reproduce this case here and we'll fix it ASAP.

We couldn't reproduce it yet, but we have a crash dump in GH issue #449, which hints at the commit cd4d819c99266 getting this double-extra-check wrong.

So if you build from git, can you do a checkout of release/2.6, and then do "git revert cd4d819c99266", and build from that? This would give you a 2.6.7 "with both CVE fixes, but without the extra safeguard check" - which isn't *really* needed, but its intention was "should another mistake of sort addressed in the CVE fixes happen again, it would get caught" - so double belt and suspenders...

gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never
doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh
Mistress

Gert Doering - Munich, Germany
[email protected]...
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#9 lore raw

Hi,

Quoted 6 lines · Greg Cox

Spun this config up, then ran:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 443,80 -j REDIRECT --to-ports 1194

Within 5 minutes the random web scanners found and segfaulted me.

This sounds promising. Hopefully we can make it crash too with that :-)

(Focus so far was on UDP because that was the first report we got, but if TCP gets the job done, even better).

Not totally trivial, though... "basic" openssl s_client or just plain "GET / HTTP/1.0" will just make OpenVPN close the link, not crash...

*keeps trying*

(If you feel like debugging a bit more - could you compile an instance without optimization, run from gdb, and when it segfaults print all local variables of interest? i, j, ks, *ks, ks->send_reliable? We got one variable print from Dmitry - thanks! - but the optimizer broke printing "ks" things)

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#10 lore raw

Hi,

Quoted 5 lines · Gert Doering

(If you feel like debugging a bit more - could you compile an instance without optimization, run from gdb, and when it segfaults print all local variables of interest? i, j, ks, *ks, ks->send_reliable? We got one variable print from Dmitry - thanks! - but the optimizer broke printing "ks" things)

Dmitry was able to do this, and has confirmed that ks->send_reliable is NULL here, because of "half-initialized state" - which can be determined by checking ks->state first (S_UNDEF = 0 --> send_reliable not yet initialized).

Thanks for your help, Dmitry and Greg. Fixed version coming soon...

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#11 lore raw
In reply to Greg Cox

Hi,

Quoted 6 lines · Greg Cox

Spun this config up, then ran:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 443,80 -j REDIRECT --to-ports 1194

Within 5 minutes the random web scanners found and segfaulted me.

... your port scanners are definitely better than mine - took more like 5 hours here to crash, but it confirms the current assumptions, ks->state being S_UNDEF and ks->send_reliable being NULL.

Now, Arne's patch (if (ks->state == S_UNDEF) { continue; }) *should* have fully fixed this, so I'm a bit surprised that we get "it still crashes" reports... will re-test with this setup and see what happens.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#12 lore raw

14.11.2023 11:05, Gert Doering пишет:

Quoted 13 lines

Hi,

Quoted 6 lines · Greg Cox

Spun this config up, then ran:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 443,80 -j REDIRECT --to-ports 1194

Within 5 minutes the random web scanners found and segfaulted me.

... your port scanners are definitely better than mine - took more like 5 hours here to crash, but it confirms the current assumptions, ks->state being S_UNDEF and ks->send_reliable being NULL.

Quoted 5 lines

Now, Arne's patch (if (ks->state == S_UNDEF) { continue; }) *should* have fully fixed this, so I'm a bit surprised that we get "it still crashes" reports... will re-test with this setup and see what happens.

gert

I'd like to confirm that after patch and more then 24hours run I have no issues.

Thank you!

#13 lore raw
In reply to Dmitry Melekhov

Hi,

Quoted 5 lines · Dmitry Melekhov

10.11.2023 00:56, Yuriy Darnobyt ??????????:

Quoted 1 line

The OpenVPN community project team is proud to release OpenVPN 2.6.7.

something is broken in 2.6.7. it stops passing traffic after several seconds after connection when acts as server,

Anything in the logs, when running with --verb 4? Is this UDP or TCP? Are you using --fragment?

I ran the full server side test setup here, and all tests pass - now, these are only running ~15 seconds per client connect, so might have overlooked something... just to be sure, I've run a 15-minute ipv4/ipv6 ping test to a UDP server now, and that succeeded just fine.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...